#ifndef SD_DISKIO_H
#define SD_DISKIO_H

#include "ff.h"                  // for BYTE, LBA_t, etc.
#include "diskio.h"             // for DSTATUS, DRESULT

#ifdef __cplusplus
extern "C" {
#endif

/** 
  * @brief  SD status structure definition  
  */     
 #define   MSD_OK         0x00
 #define   MSD_ERROR      0x01
 
 /** 
   * @brief  SD transfer state definition  
   */     
 #define   SD_TRANSFER_OK                ((uint8_t)0x00)
 #define   SD_TRANSFER_BUSY              ((uint8_t)0x01)

uint8_t BSP_SD_GetCardState(void);
DSTATUS SD_CheckStatus(void);

DSTATUS SD_status(void);
DSTATUS SD_initialize(void);
DRESULT SD_read(BYTE *buff, LBA_t sector, UINT count);
DRESULT SD_write(const BYTE *buff, LBA_t sector, UINT count);

#ifdef __cplusplus
}
#endif

#endif // SD_DISKIO_H
